/**
 * 新增工种名称
 * 宁建浩
 * 2017/8/21  14:00
 * */
var testConfig = require('../testConfig');
var testDatas = require('../testData');
function SearchProject() {
  this.beforeTr = 0;
  this.init = function () {
    var arr = [];
    arr.push(this.step1,
      this.step2,
      this.step3,
      this.step4,
      this.step5,
      this.step6,
      this.step7);
    testConfig.testFun.runStep(arr);
  };
  this.step1 = function () {
    $("#aside-nav").find("div.in").find("li").eq(2)[0].click();
  };
  this.step2 = function () {
    testConfig.testFun.ai().find(".manage").find(".tname")[0].click();
  };
  this.step3 = function () {
    testConfig.testFun.ai().find("#id-team-slc")[0].click();
  };
  this.step4 = function () {
    testConfig.testFun.ai().find("#allList").find("li").eq(3)[0].click();
  };
  this.step5 = function () {
    var _FmtStatus = document.getElementById('contentIframe').contentWindow.$("body").data("_FmtStatus");
    var ve = testConfig.testFun.ai().find("#name-con")[0].__vue__;
    _FmtStatus.isAdd = false;
    _FmtStatus.isCompile = -1;
    _FmtStatus.isMoved = false;
    testConfig.testFun.ai().find(".addTeamClassBtn")[0].click();
    ve.$children[0].rows.push({isCompile: "add", isRead: false});
  };
  this.step6 = function () {
    testConfig.testFun.ai().find('table tr:last-child input').val(testDatas.testFun.workTypeName);
    var ve = testConfig.testFun.ai().find("#name-con")[0].__vue__;
    ve.$children[0].rows[ve.rows.length - 1].projectType = testDatas.testFun.workTypeName;
  };
  this.step7 = function () {
    testConfig.testFun.ai().find("#name-con .sort-confirm")[0].click();
  }
}
function testStart() {
  var test = new SearchProject();
  test.init();
}
exports.start = testStart;